<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def from_db(cls, db, force=False):
 """Make instance from database. For performance, this caches the episode types for the database. The `force` parameter can be used to bypass this. """

        if force or db not in cls._cache:
            cls._cache[db] = cls._new_from_db(db)
        return cls._cache[db]