python implementation of distribute cache