code: def set_memory_cache(self, results, key=None):
          
          key = self.model.hash if key is None else key
          self.memory_cache[key] = results
docs: Store result in memory cache with key matching model state.