def METHOD_NAME():
    @dataclass(frozen=True)
    class ValidImpl(AbstractExternalResource):
        is_local: bool = False
        def _do_activate(self, is_local):
            return replace(
                self,
                is_local=is_local,
                status=ResourceStatus(
                    state=ResourceState.ACTIVATING,
                    message="updating",
                    managed_by=ManagedBy.RESOLVER if is_local else ManagedBy.SERVER,
                ),
            )
    activating_local = ValidImpl().activate(True)
    activating_remote = ValidImpl().activate(False)
    assert activating_local.is_local
    assert not activating_remote.is_local
    @dataclass(frozen=True)
    class InvalidImpl(AbstractExternalResource):
        is_local: bool = False
        def _do_activate(self, is_local):
            return replace(
                self,
                is_local=is_local,
                status=ResourceStatus(
                    state=ResourceState.CREATED,
                    message="updating",
                    managed_by=ManagedBy.RESOLVER if is_local else ManagedBy.SERVER,
                ),
            )
    with pytest.raises(IllegalStateTransitionError):
        InvalidImpl().activate(True)