def __enter__(self):
    cls = type(self)
    self.__previous_instances.append(cls._contexts.current.get(cls.__name__, None))
    cls._contexts.current[cls.__name__] = self
Sets this instance to be the currently in-scope instance of its class.
dataset/ETHPy150Open viewfinderco/viewfinder/backend/base/context_local.py/ContextLocal.__enter__