<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set(self, key, value):
 """Set persistent data with shelve. :param key: string: Index key :param value: All supported data types in python :raises: :returns: """

        db = self.open()
        try:
            db[key] = value
        finally:
            db.close()