def METHOD_NAME(self, span: Span, finish_on_close: bool) -> Scope:
    """
    Makes a Span active.
    Args
        span: the span that should become active.
        finish_on_close: whether Span should be automatically finished when
            Scope.close() is called.
    Returns:
        Scope to control the end of the active period for
        *span*. It is a programming error to neglect to call
        Scope.close() on the returned instance.
    """
    ctx = current_context()
    if not ctx:
        logger.error("Tried to activate scope outside of loggingcontext")
        return Scope(None, span)  # type: ignore[arg-type]
    if ctx.scope is not None:
        # start a new logging context as a child of the existing one.
        # Doing so -- rather than updating the existing logcontext -- means that
        # creating several concurrent spans under the same logcontext works
        # correctly.
        ctx = nested_logging_context("")
        enter_logcontext = True
    else:
        # if there is no span currently associated with the current logcontext, we
        # just store the scope in it.
        #
        # This feels a bit dubious, but it does hack around a problem where a
        # span outlasts its parent logcontext (which would otherwise lead to
        # "Re-starting finished log context" errors).
        enter_logcontext = False
    scope = _LogContextScope(self, span, ctx, enter_logcontext, finish_on_close)
    ctx.scope = scope
    if enter_logcontext:
        ctx.__enter__()
    return scope