def METHOD_NAME(
    self,
    carrier: CarrierT,
    context: Optional[Context] = None,
    getter: Getter[CarrierT] = default_getter,
) -> Context:
    if context is None:
        context = Context()
    traceid = _extract_identifier(
        getter.get(carrier, OT_TRACE_ID_HEADER),
        _valid_extract_traceid,
        INVALID_TRACE_ID,
    )
    spanid = _extract_identifier(
        getter.get(carrier, OT_SPAN_ID_HEADER),
        _valid_extract_spanid,
        INVALID_SPAN_ID,
    )
    sampled = _extract_first_element(
        getter.get(carrier, OT_SAMPLED_HEADER)
    )
    if sampled == "true":
        traceflags = TraceFlags.SAMPLED
    else:
        traceflags = TraceFlags.DEFAULT
    if traceid != INVALID_TRACE_ID and spanid != INVALID_SPAN_ID:
        context = set_span_in_context(
            NonRecordingSpan(
                SpanContext(
                    trace_id=traceid,
                    span_id=spanid,
                    is_remote=True,
                    trace_flags=TraceFlags(traceflags),
                )
            ),
            context,
        )
        baggage = get_all(context) or {}
        for key in getter.keys(carrier):
            if not key.startswith(OT_BAGGAGE_PREFIX):
                continue
            baggage[
                key[len(OT_BAGGAGE_PREFIX) :]
            ] = _extract_first_element(getter.get(carrier, key))
        for key, value in baggage.items():
            context = set_baggage(key, value, context)
    return context