<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 When we call this function twice with the same argument, it does not get executed the second time, and the output gets loaded from the pickle file
Step1:  using memmapping
To speed up cache looking of large numpy arrays, you can load them using memmapping (memory mapping)
<ASSISTANT_TASK:>
Python Code:
import numpy as np
@memory.cache
def g(x):
     print('A long-running calculation, with parameter %s' % x)
     return np.hamming(x)
@memory.cache
def h(x):
    print('A second long-running calculation, using g(x)')
    return np.vander(x)
a = g(3)
a
g(3)
h(a)
h(a)
Explanation: When we call this function twice with the same argument, it does not get executed the second time, and the output gets loaded from the pickle file:
Using with numpy
End of explanation
cachedir2 = mkdtemp()
memory2 = Memory(cachedir=cachedir2, mmap_mode='r')
square = memory2.cache(np.square)
a = np.vander(np.arange(3)).astype(np.float)
square(a)
# call it again
res = square(a)
res
Explanation: using memmapping
To speed up cache looking of large numpy arrays, you can load them using memmapping (memory mapping):
End of explanation
<END_TASK>