@classmethod
    def state(cls, obj, state=None):
        if state is None:
            ids = cls.capture_ids(obj)
            original_custom_keys = set(Store.custom_options().keys())
            return (ids, original_custom_keys)
        else:
            (ids, original_custom_keys) = state
            current_custom_keys = set(Store.custom_options().keys())
            for key in current_custom_keys.difference(original_custom_keys):
                del Store.custom_options()[key]
                cls.restore_ids(obj, ids)
Method to capture and restore option state. When called
dataset/ETHPy150Open ioam/holoviews/holoviews/core/options.py/StoreOptions.state