Python code for implementing a reference manager