We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Support memoization of tuples
We already support lists, so implementing an `id_for_memo` for tuple types is straightforward. 


--- 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/dataflow/memoization.py`
Content:
```
1 import hashlib
2 from functools import singledispatch
3 import logging
4 from parsl.serialize import serialize
5 import types
6 
7 logger = logging.getLogger(__name__)
8 
9 
10 @singledispatch
11 def id_for_memo(obj, output_ref=False):
12     """This should return a byte sequence which identifies the supplied
13     value for memoization purposes: for any two calls of id_for_memo,
14     the byte sequence should be the same when the "same" value is supplied,
15     and different otherwise.
16 
17     "same" is in quotes about because sameness is not as straightforward as
18     serialising out the content.
19 
20     For example, for two dicts x, y:
21 
22       x = {"a":3, "b":4}
23       y = {"b":4, "a":3}
24 
25     then: x == y, but their serialization is not equal, and some other
26     functions on x and y are not equal: list(x.keys()) != list(y.keys())
27 
28 
29     id_for_memo is invoked with output_ref=True when the parameter is an
30     output reference (a value in the outputs=[] parameter of an app
31     invocation).
32 
33     Memo hashing might be different for such parameters: for example, a
34     user might choose to hash input File content so that changing the
35     content of an input file invalidates memoization. This does not make
36     sense to do for output files: there is no meaningful content stored
37     where an output filename points at memoization time.
38     """
39     logger.error("id_for_memo attempted on unknown type {}".format(type(obj)))
40     raise ValueError("unknown type for memoization: {}".format(type(obj)))
41 
42 
43 @id_for_memo.register(str)
44 @id_for_memo.register(int)
45 @id_for_memo.register(float)
46 @id_for_memo.register(types.FunctionType)
47 @id_for_memo.register(type(None))
48 def id_for_memo_serialize(obj, output_ref=False):
49     return serialize(obj)
50 
51 
52 @id_for_memo.register(list)
53 def id_for_memo_list(denormalized_list, output_ref=False):
54     if type(denormalized_list) != list:
55         raise ValueError("id_for_memo_list cannot work on subclasses of list")
56 
57     normalized_list = []
58 
59     for e in denormalized_list:
60         normalized_list.append(id_for_memo(e, output_ref=output_ref))
61 
62     return serialize(normalized_list)
63 
64 
65 @id_for_memo.register(dict)
66 def id_for_memo_dict(denormalized_dict, output_ref=False):
67     """This normalises the keys and values of the supplied dictionary.
68 
69     When output_ref=True, the values are normalised as output refs, but
70     the keys are not.
71     """
72     if type(denormalized_dict) != dict:
73         raise ValueError("id_for_memo_dict cannot work on subclasses of dict")
74 
75     keys = sorted(denormalized_dict)
76 
77     normalized_list = []
78     for k in keys:
79         normalized_list.append(id_for_memo(k))
80         normalized_list.append(id_for_memo(denormalized_dict[k], output_ref=output_ref))
81     return serialize(normalized_list)
82 
83 
84 class Memoizer(object):
85     """Memoizer is responsible for ensuring that identical work is not repeated.
86 
87     When a task is repeated, i.e., the same function is called with the same exact arguments, the
88     result from a previous execution is reused. `wiki <https://en.wikipedia.org/wiki/Memoization>`_
89 
90     The memoizer implementation here does not collapse duplicate calls
91     at call time, but works **only** when the result of a previous
92     call is available at the time the duplicate call is made.
93 
94     For instance::
95 
96        No advantage from                 Memoization helps
97        memoization here:                 here:
98 
99         TaskA                            TaskB
100           |   TaskA                        |
101           |     |   TaskA                done  (TaskB)
102           |     |     |                                (TaskB)
103         done    |     |
104               done    |
105                     done
106 
107     The memoizer creates a lookup table by hashing the function name
108     and its inputs, and storing the results of the function.
109 
110     When a task is ready for launch, i.e., all of its arguments
111     have resolved, we add its hash to the task datastructure.
112     """
113 
114     def __init__(self, dfk, memoize=True, checkpoint={}):
115         """Initialize the memoizer.
116 
117         Args:
118             - dfk (DFK obj): The DFK object
119 
120         KWargs:
121             - memoize (Bool): enable memoization or not.
122             - checkpoint (Dict): A checkpoint loaded as a dict.
123         """
124         self.dfk = dfk
125         self.memoize = memoize
126 
127         if self.memoize:
128             logger.info("App caching initialized")
129             self.memo_lookup_table = checkpoint
130         else:
131             logger.info("App caching disabled for all apps")
132             self.memo_lookup_table = {}
133 
134     def make_hash(self, task):
135         """Create a hash of the task inputs.
136 
137         If this fails here, then all ipp calls are also likely to fail due to failure
138         at serialization.
139 
140         Args:
141             - task (dict) : Task dictionary from dfk.tasks
142 
143         Returns:
144             - hash (str) : A unique hash string
145         """
146         # Function name TODO: Add fn body later
147 
148         t = []
149 
150         # if kwargs contains an outputs parameter, that parameter is removed
151         # and normalised differently - with output_ref set to True.
152         # kwargs listed in ignore_for_cache will also be removed
153 
154         filtered_kw = task['kwargs'].copy()
155 
156         ignore_list = task['ignore_for_cache']
157 
158         logger.debug("Ignoring these kwargs for checkpointing: {}".format(ignore_list))
159         for k in ignore_list:
160             logger.debug("Ignoring kwarg {}".format(k))
161             del filtered_kw[k]
162 
163         if 'outputs' in task['kwargs']:
164             outputs = task['kwargs']['outputs']
165             del filtered_kw['outputs']
166             t = t + [id_for_memo(outputs, output_ref=True)]   # TODO: use append?
167 
168         t = t + [id_for_memo(filtered_kw)]
169         t = t + [id_for_memo(task['func_name']),
170                  id_for_memo(task['fn_hash']),
171                  id_for_memo(task['args'])]
172 
173         x = b''.join(t)
174         hashedsum = hashlib.md5(x).hexdigest()
175         return hashedsum
176 
177     def check_memo(self, task_id, task):
178         """Create a hash of the task and its inputs and check the lookup table for this hash.
179 
180         If present, the results are returned. The result is a tuple indicating whether a memo
181         exists and the result, since a None result is possible and could be confusing.
182         This seems like a reasonable option without relying on a cache_miss exception.
183 
184         Args:
185             - task(task) : task from the dfk.tasks table
186 
187         Returns:
188             - Result (Future): A completed future containing the memoized result
189 
190         This call will also set task['hashsum'] to the unique hashsum for the func+inputs.
191         """
192         if not self.memoize or not task['memoize']:
193             task['hashsum'] = None
194             logger.debug("Task {} will not be memoized".format(task_id))
195             return None
196 
197         hashsum = self.make_hash(task)
198         logger.debug("Task {} has memoization hash {}".format(task_id, hashsum))
199         result = None
200         if hashsum in self.memo_lookup_table:
201             result = self.memo_lookup_table[hashsum]
202             logger.info("Task %s using result from cache", task_id)
203         else:
204             logger.info("Task %s had no result in cache", task_id)
205 
206         task['hashsum'] = hashsum
207 
208         return result
209 
210     def hash_lookup(self, hashsum):
211         """Lookup a hash in the memoization table.
212 
213         Args:
214             - hashsum (str): The same hashes used to uniquely identify apps+inputs
215 
216         Returns:
217             - Lookup result
218 
219         Raises:
220             - KeyError: if hash not in table
221         """
222         return self.memo_lookup_table[hashsum]
223 
224     def update_memo(self, task_id, task, r):
225         """Updates the memoization lookup table with the result from a task.
226 
227         Args:
228              - task_id (int): Integer task id
229              - task (dict) : A task dict from dfk.tasks
230              - r (Result future): Result future
231 
232         A warning is issued when a hash collision occurs during the update.
233         This is not likely.
234         """
235         if not self.memoize or not task['memoize'] or 'hashsum' not in task:
236             return
237 
238         if task['hashsum'] in self.memo_lookup_table:
239             logger.info('Updating app cache entry with latest %s:%s call' %
240                         (task['func_name'], task_id))
241             self.memo_lookup_table[task['hashsum']] = r
242         else:
243             self.memo_lookup_table[task['hashsum']] = r
244
```
--- 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/dataflow/memoization.py b/parsl/dataflow/memoization.py
--- a/parsl/dataflow/memoization.py
+++ b/parsl/dataflow/memoization.py
@@ -62,6 +62,19 @@
     return serialize(normalized_list)
 
 
+@id_for_memo.register(tuple)
+def id_for_memo_tuple(denormalized_tuple, output_ref=False):
+    if type(denormalized_tuple) != tuple:
+        raise ValueError("id_for_memo_tuple cannot work on subclasses of tuple")
+
+    normalized_list = []
+
+    for e in denormalized_tuple:
+        normalized_list.append(id_for_memo(e, output_ref=output_ref))
+
+    return serialize(normalized_list)
+
+
 @id_for_memo.register(dict)
 def id_for_memo_dict(denormalized_dict, output_ref=False):
     """This normalises the keys and values of the supplied dictionary.

{"golden_diff": "diff --git a/parsl/dataflow/memoization.py b/parsl/dataflow/memoization.py\n--- a/parsl/dataflow/memoization.py\n+++ b/parsl/dataflow/memoization.py\n@@ -62,6 +62,19 @@\n     return serialize(normalized_list)\n \n \n+@id_for_memo.register(tuple)\n+def id_for_memo_tuple(denormalized_tuple, output_ref=False):\n+    if type(denormalized_tuple) != tuple:\n+        raise ValueError(\"id_for_memo_tuple cannot work on subclasses of tuple\")\n+\n+    normalized_list = []\n+\n+    for e in denormalized_tuple:\n+        normalized_list.append(id_for_memo(e, output_ref=output_ref))\n+\n+    return serialize(normalized_list)\n+\n+\n @id_for_memo.register(dict)\n def id_for_memo_dict(denormalized_dict, output_ref=False):\n     \"\"\"This normalises the keys and values of the supplied dictionary.\n", "issue": "Support memoization of tuples\nWe already support lists, so implementing an `id_for_memo` for tuple types is straightforward. \r\n\n", "before_files": [{"content": "import hashlib\nfrom functools import singledispatch\nimport logging\nfrom parsl.serialize import serialize\nimport types\n\nlogger = logging.getLogger(__name__)\n\n\n@singledispatch\ndef id_for_memo(obj, output_ref=False):\n    \"\"\"This should return a byte sequence which identifies the supplied\n    value for memoization purposes: for any two calls of id_for_memo,\n    the byte sequence should be the same when the \"same\" value is supplied,\n    and different otherwise.\n\n    \"same\" is in quotes about because sameness is not as straightforward as\n    serialising out the content.\n\n    For example, for two dicts x, y:\n\n      x = {\"a\":3, \"b\":4}\n      y = {\"b\":4, \"a\":3}\n\n    then: x == y, but their serialization is not equal, and some other\n    functions on x and y are not equal: list(x.keys()) != list(y.keys())\n\n\n    id_for_memo is invoked with output_ref=True when the parameter is an\n    output reference (a value in the outputs=[] parameter of an app\n    invocation).\n\n    Memo hashing might be different for such parameters: for example, a\n    user might choose to hash input File content so that changing the\n    content of an input file invalidates memoization. This does not make\n    sense to do for output files: there is no meaningful content stored\n    where an output filename points at memoization time.\n    \"\"\"\n    logger.error(\"id_for_memo attempted on unknown type {}\".format(type(obj)))\n    raise ValueError(\"unknown type for memoization: {}\".format(type(obj)))\n\n\n@id_for_memo.register(str)\n@id_for_memo.register(int)\n@id_for_memo.register(float)\n@id_for_memo.register(types.FunctionType)\n@id_for_memo.register(type(None))\ndef id_for_memo_serialize(obj, output_ref=False):\n    return serialize(obj)\n\n\n@id_for_memo.register(list)\ndef id_for_memo_list(denormalized_list, output_ref=False):\n    if type(denormalized_list) != list:\n        raise ValueError(\"id_for_memo_list cannot work on subclasses of list\")\n\n    normalized_list = []\n\n    for e in denormalized_list:\n        normalized_list.append(id_for_memo(e, output_ref=output_ref))\n\n    return serialize(normalized_list)\n\n\n@id_for_memo.register(dict)\ndef id_for_memo_dict(denormalized_dict, output_ref=False):\n    \"\"\"This normalises the keys and values of the supplied dictionary.\n\n    When output_ref=True, the values are normalised as output refs, but\n    the keys are not.\n    \"\"\"\n    if type(denormalized_dict) != dict:\n        raise ValueError(\"id_for_memo_dict cannot work on subclasses of dict\")\n\n    keys = sorted(denormalized_dict)\n\n    normalized_list = []\n    for k in keys:\n        normalized_list.append(id_for_memo(k))\n        normalized_list.append(id_for_memo(denormalized_dict[k], output_ref=output_ref))\n    return serialize(normalized_list)\n\n\nclass Memoizer(object):\n    \"\"\"Memoizer is responsible for ensuring that identical work is not repeated.\n\n    When a task is repeated, i.e., the same function is called with the same exact arguments, the\n    result from a previous execution is reused. `wiki <https://en.wikipedia.org/wiki/Memoization>`_\n\n    The memoizer implementation here does not collapse duplicate calls\n    at call time, but works **only** when the result of a previous\n    call is available at the time the duplicate call is made.\n\n    For instance::\n\n       No advantage from                 Memoization helps\n       memoization here:                 here:\n\n        TaskA                            TaskB\n          |   TaskA                        |\n          |     |   TaskA                done  (TaskB)\n          |     |     |                                (TaskB)\n        done    |     |\n              done    |\n                    done\n\n    The memoizer creates a lookup table by hashing the function name\n    and its inputs, and storing the results of the function.\n\n    When a task is ready for launch, i.e., all of its arguments\n    have resolved, we add its hash to the task datastructure.\n    \"\"\"\n\n    def __init__(self, dfk, memoize=True, checkpoint={}):\n        \"\"\"Initialize the memoizer.\n\n        Args:\n            - dfk (DFK obj): The DFK object\n\n        KWargs:\n            - memoize (Bool): enable memoization or not.\n            - checkpoint (Dict): A checkpoint loaded as a dict.\n        \"\"\"\n        self.dfk = dfk\n        self.memoize = memoize\n\n        if self.memoize:\n            logger.info(\"App caching initialized\")\n            self.memo_lookup_table = checkpoint\n        else:\n            logger.info(\"App caching disabled for all apps\")\n            self.memo_lookup_table = {}\n\n    def make_hash(self, task):\n        \"\"\"Create a hash of the task inputs.\n\n        If this fails here, then all ipp calls are also likely to fail due to failure\n        at serialization.\n\n        Args:\n            - task (dict) : Task dictionary from dfk.tasks\n\n        Returns:\n            - hash (str) : A unique hash string\n        \"\"\"\n        # Function name TODO: Add fn body later\n\n        t = []\n\n        # if kwargs contains an outputs parameter, that parameter is removed\n        # and normalised differently - with output_ref set to True.\n        # kwargs listed in ignore_for_cache will also be removed\n\n        filtered_kw = task['kwargs'].copy()\n\n        ignore_list = task['ignore_for_cache']\n\n        logger.debug(\"Ignoring these kwargs for checkpointing: {}\".format(ignore_list))\n        for k in ignore_list:\n            logger.debug(\"Ignoring kwarg {}\".format(k))\n            del filtered_kw[k]\n\n        if 'outputs' in task['kwargs']:\n            outputs = task['kwargs']['outputs']\n            del filtered_kw['outputs']\n            t = t + [id_for_memo(outputs, output_ref=True)]   # TODO: use append?\n\n        t = t + [id_for_memo(filtered_kw)]\n        t = t + [id_for_memo(task['func_name']),\n                 id_for_memo(task['fn_hash']),\n                 id_for_memo(task['args'])]\n\n        x = b''.join(t)\n        hashedsum = hashlib.md5(x).hexdigest()\n        return hashedsum\n\n    def check_memo(self, task_id, task):\n        \"\"\"Create a hash of the task and its inputs and check the lookup table for this hash.\n\n        If present, the results are returned. The result is a tuple indicating whether a memo\n        exists and the result, since a None result is possible and could be confusing.\n        This seems like a reasonable option without relying on a cache_miss exception.\n\n        Args:\n            - task(task) : task from the dfk.tasks table\n\n        Returns:\n            - Result (Future): A completed future containing the memoized result\n\n        This call will also set task['hashsum'] to the unique hashsum for the func+inputs.\n        \"\"\"\n        if not self.memoize or not task['memoize']:\n            task['hashsum'] = None\n            logger.debug(\"Task {} will not be memoized\".format(task_id))\n            return None\n\n        hashsum = self.make_hash(task)\n        logger.debug(\"Task {} has memoization hash {}\".format(task_id, hashsum))\n        result = None\n        if hashsum in self.memo_lookup_table:\n            result = self.memo_lookup_table[hashsum]\n            logger.info(\"Task %s using result from cache\", task_id)\n        else:\n            logger.info(\"Task %s had no result in cache\", task_id)\n\n        task['hashsum'] = hashsum\n\n        return result\n\n    def hash_lookup(self, hashsum):\n        \"\"\"Lookup a hash in the memoization table.\n\n        Args:\n            - hashsum (str): The same hashes used to uniquely identify apps+inputs\n\n        Returns:\n            - Lookup result\n\n        Raises:\n            - KeyError: if hash not in table\n        \"\"\"\n        return self.memo_lookup_table[hashsum]\n\n    def update_memo(self, task_id, task, r):\n        \"\"\"Updates the memoization lookup table with the result from a task.\n\n        Args:\n             - task_id (int): Integer task id\n             - task (dict) : A task dict from dfk.tasks\n             - r (Result future): Result future\n\n        A warning is issued when a hash collision occurs during the update.\n        This is not likely.\n        \"\"\"\n        if not self.memoize or not task['memoize'] or 'hashsum' not in task:\n            return\n\n        if task['hashsum'] in self.memo_lookup_table:\n            logger.info('Updating app cache entry with latest %s:%s call' %\n                        (task['func_name'], task_id))\n            self.memo_lookup_table[task['hashsum']] = r\n        else:\n            self.memo_lookup_table[task['hashsum']] = r\n", "path": "parsl/dataflow/memoization.py"}], "after_files": [{"content": "import hashlib\nfrom functools import singledispatch\nimport logging\nfrom parsl.serialize import serialize\nimport types\n\nlogger = logging.getLogger(__name__)\n\n\n@singledispatch\ndef id_for_memo(obj, output_ref=False):\n    \"\"\"This should return a byte sequence which identifies the supplied\n    value for memoization purposes: for any two calls of id_for_memo,\n    the byte sequence should be the same when the \"same\" value is supplied,\n    and different otherwise.\n\n    \"same\" is in quotes about because sameness is not as straightforward as\n    serialising out the content.\n\n    For example, for two dicts x, y:\n\n      x = {\"a\":3, \"b\":4}\n      y = {\"b\":4, \"a\":3}\n\n    then: x == y, but their serialization is not equal, and some other\n    functions on x and y are not equal: list(x.keys()) != list(y.keys())\n\n\n    id_for_memo is invoked with output_ref=True when the parameter is an\n    output reference (a value in the outputs=[] parameter of an app\n    invocation).\n\n    Memo hashing might be different for such parameters: for example, a\n    user might choose to hash input File content so that changing the\n    content of an input file invalidates memoization. This does not make\n    sense to do for output files: there is no meaningful content stored\n    where an output filename points at memoization time.\n    \"\"\"\n    logger.error(\"id_for_memo attempted on unknown type {}\".format(type(obj)))\n    raise ValueError(\"unknown type for memoization: {}\".format(type(obj)))\n\n\n@id_for_memo.register(str)\n@id_for_memo.register(int)\n@id_for_memo.register(float)\n@id_for_memo.register(types.FunctionType)\n@id_for_memo.register(type(None))\ndef id_for_memo_serialize(obj, output_ref=False):\n    return serialize(obj)\n\n\n@id_for_memo.register(list)\ndef id_for_memo_list(denormalized_list, output_ref=False):\n    if type(denormalized_list) != list:\n        raise ValueError(\"id_for_memo_list cannot work on subclasses of list\")\n\n    normalized_list = []\n\n    for e in denormalized_list:\n        normalized_list.append(id_for_memo(e, output_ref=output_ref))\n\n    return serialize(normalized_list)\n\n\n@id_for_memo.register(tuple)\ndef id_for_memo_tuple(denormalized_tuple, output_ref=False):\n    if type(denormalized_tuple) != tuple:\n        raise ValueError(\"id_for_memo_tuple cannot work on subclasses of tuple\")\n\n    normalized_list = []\n\n    for e in denormalized_tuple:\n        normalized_list.append(id_for_memo(e, output_ref=output_ref))\n\n    return serialize(normalized_list)\n\n\n@id_for_memo.register(dict)\ndef id_for_memo_dict(denormalized_dict, output_ref=False):\n    \"\"\"This normalises the keys and values of the supplied dictionary.\n\n    When output_ref=True, the values are normalised as output refs, but\n    the keys are not.\n    \"\"\"\n    if type(denormalized_dict) != dict:\n        raise ValueError(\"id_for_memo_dict cannot work on subclasses of dict\")\n\n    keys = sorted(denormalized_dict)\n\n    normalized_list = []\n    for k in keys:\n        normalized_list.append(id_for_memo(k))\n        normalized_list.append(id_for_memo(denormalized_dict[k], output_ref=output_ref))\n    return serialize(normalized_list)\n\n\nclass Memoizer(object):\n    \"\"\"Memoizer is responsible for ensuring that identical work is not repeated.\n\n    When a task is repeated, i.e., the same function is called with the same exact arguments, the\n    result from a previous execution is reused. `wiki <https://en.wikipedia.org/wiki/Memoization>`_\n\n    The memoizer implementation here does not collapse duplicate calls\n    at call time, but works **only** when the result of a previous\n    call is available at the time the duplicate call is made.\n\n    For instance::\n\n       No advantage from                 Memoization helps\n       memoization here:                 here:\n\n        TaskA                            TaskB\n          |   TaskA                        |\n          |     |   TaskA                done  (TaskB)\n          |     |     |                                (TaskB)\n        done    |     |\n              done    |\n                    done\n\n    The memoizer creates a lookup table by hashing the function name\n    and its inputs, and storing the results of the function.\n\n    When a task is ready for launch, i.e., all of its arguments\n    have resolved, we add its hash to the task datastructure.\n    \"\"\"\n\n    def __init__(self, dfk, memoize=True, checkpoint={}):\n        \"\"\"Initialize the memoizer.\n\n        Args:\n            - dfk (DFK obj): The DFK object\n\n        KWargs:\n            - memoize (Bool): enable memoization or not.\n            - checkpoint (Dict): A checkpoint loaded as a dict.\n        \"\"\"\n        self.dfk = dfk\n        self.memoize = memoize\n\n        if self.memoize:\n            logger.info(\"App caching initialized\")\n            self.memo_lookup_table = checkpoint\n        else:\n            logger.info(\"App caching disabled for all apps\")\n            self.memo_lookup_table = {}\n\n    def make_hash(self, task):\n        \"\"\"Create a hash of the task inputs.\n\n        If this fails here, then all ipp calls are also likely to fail due to failure\n        at serialization.\n\n        Args:\n            - task (dict) : Task dictionary from dfk.tasks\n\n        Returns:\n            - hash (str) : A unique hash string\n        \"\"\"\n        # Function name TODO: Add fn body later\n\n        t = []\n\n        # if kwargs contains an outputs parameter, that parameter is removed\n        # and normalised differently - with output_ref set to True.\n        # kwargs listed in ignore_for_cache will also be removed\n\n        filtered_kw = task['kwargs'].copy()\n\n        ignore_list = task['ignore_for_cache']\n\n        logger.debug(\"Ignoring these kwargs for checkpointing: {}\".format(ignore_list))\n        for k in ignore_list:\n            logger.debug(\"Ignoring kwarg {}\".format(k))\n            del filtered_kw[k]\n\n        if 'outputs' in task['kwargs']:\n            outputs = task['kwargs']['outputs']\n            del filtered_kw['outputs']\n            t = t + [id_for_memo(outputs, output_ref=True)]   # TODO: use append?\n\n        t = t + [id_for_memo(filtered_kw)]\n        t = t + [id_for_memo(task['func_name']),\n                 id_for_memo(task['fn_hash']),\n                 id_for_memo(task['args'])]\n\n        x = b''.join(t)\n        hashedsum = hashlib.md5(x).hexdigest()\n        return hashedsum\n\n    def check_memo(self, task_id, task):\n        \"\"\"Create a hash of the task and its inputs and check the lookup table for this hash.\n\n        If present, the results are returned. The result is a tuple indicating whether a memo\n        exists and the result, since a None result is possible and could be confusing.\n        This seems like a reasonable option without relying on a cache_miss exception.\n\n        Args:\n            - task(task) : task from the dfk.tasks table\n\n        Returns:\n            - Result (Future): A completed future containing the memoized result\n\n        This call will also set task['hashsum'] to the unique hashsum for the func+inputs.\n        \"\"\"\n        if not self.memoize or not task['memoize']:\n            task['hashsum'] = None\n            logger.debug(\"Task {} will not be memoized\".format(task_id))\n            return None\n\n        hashsum = self.make_hash(task)\n        logger.debug(\"Task {} has memoization hash {}\".format(task_id, hashsum))\n        result = None\n        if hashsum in self.memo_lookup_table:\n            result = self.memo_lookup_table[hashsum]\n            logger.info(\"Task %s using result from cache\", task_id)\n        else:\n            logger.info(\"Task %s had no result in cache\", task_id)\n\n        task['hashsum'] = hashsum\n\n        return result\n\n    def hash_lookup(self, hashsum):\n        \"\"\"Lookup a hash in the memoization table.\n\n        Args:\n            - hashsum (str): The same hashes used to uniquely identify apps+inputs\n\n        Returns:\n            - Lookup result\n\n        Raises:\n            - KeyError: if hash not in table\n        \"\"\"\n        return self.memo_lookup_table[hashsum]\n\n    def update_memo(self, task_id, task, r):\n        \"\"\"Updates the memoization lookup table with the result from a task.\n\n        Args:\n             - task_id (int): Integer task id\n             - task (dict) : A task dict from dfk.tasks\n             - r (Result future): Result future\n\n        A warning is issued when a hash collision occurs during the update.\n        This is not likely.\n        \"\"\"\n        if not self.memoize or not task['memoize'] or 'hashsum' not in task:\n            return\n\n        if task['hashsum'] in self.memo_lookup_table:\n            logger.info('Updating app cache entry with latest %s:%s call' %\n                        (task['func_name'], task_id))\n            self.memo_lookup_table[task['hashsum']] = r\n        else:\n            self.memo_lookup_table[task['hashsum']] = r\n", "path": "parsl/dataflow/memoization.py"}]}