Context manager for AttrSpec initialization.
Source code in dp3/common/context.py
| @contextmanager
def entity_context(self_spec, entities: dict) -> Iterator[None]:
"""Context manager for AttrSpec initialization."""
token = _init_attr_spec_context_var.set({"self": self_spec, "entities": entities})
try:
yield
finally:
_init_attr_spec_context_var.reset(token)
|