@classmethod
    def flush_instance_cache(cls, force=False):
        if force:
            cls.__dbclass__.__instance_cache__ = {}
        else:
            cls.__dbclass__.__instance_cache__ = dict((key, obj) for key, obj in cls.__dbclass__.__instance_cache__.items()
                                                      if obj._idmapper_recache_protection)
    #flush_instance_cache = classmethod(flush_instance_cache)

    # per-instance methods
This will clean safe objects from the cache. Use `force`
dataset/ETHPy150Open evennia/evennia/evennia/utils/idmapper/models.py/SharedMemoryModel.flush_instance_cache