title: How to set the return value in joblib's cache explicitly?
body: <p>I want to set the cached value of a function for a given argument list using <a href="https://joblib.readthedocs.io/en/latest/memory.html" rel="nofollow noreferrer">joblib's Memory</a>. Something like this:</p>
  <pre class="lang-py prettyprint-override"><code>from joblib import Memory
  
  memory = Memory('cachedir')
  
  @memory.cache
  def f(x):
      # Placeholder for a heavy task
      print('Running f(%s)' % x)
      return 'Return and store this string %s' % x
  
  # The following line isn't working, but I want something similar:
  memory.set_cached_value(f, 1234, 'Return and store this string 1234')
  </code></pre>
  <p>I know that the simplest way is to call <code>f</code> with the given arguments (<code>1234</code>). But in my case (sometimes) the result is available without calculation so I want to set without calling the heavy <code>f</code>.</p>
  <p>Is there any similar (working) to: <code>memory.set_cached_value(f, 1234, 'Return and store this string 1234')</code>?</p>