def METHOD_NAME(self) -> Self:
    """Finalise the context, dis-allowing any further modifications.
    Returns
    -------
    Self
        The context itself to enable chained calls.
    """
    self._final = True
    return self