I have a machine learning model saved in a shelve file and I want to open it to make some predictions. Normally what I do is:
with shelve.open(file) as shlv: