@optional_arg_class_decorator<EOL>def with_default_context(cls,<EOL>use_empty_init=False,<EOL>global_default_factory=None):
if use_empty_init:<EOL><INDENT>if global_default_factory is not None:<EOL><INDENT>warnings.warn("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>global_default_factory = lambda: cls()<EOL><DEDENT>class_attrs = dict(_default_stack=DefaultStack(),<EOL>_global_default_factory=global_default_factory)<EOL>class_attrs.update(cls.__dict__)<EOL>return type(cls.__name__, (cls, _DefaultContextMixin), class_attrs)<EOL>
:param use_empty_init: If set to True, object constructed without
        arguments will be a global default object of the class.
:param global_default_factory: Function that constructs a global
        default object of the class.

N.B. Either `use_empty_init` should be set to True, or the
`global_default_factory` should be passed, but not both.