def _maybe_get_extra(origin: type) -> Union[(type, str)]:
    if any(((origin is cls) for cls in CONTEXT_MANAGER_TYPES)):
        return 'typing.ContextManager'
    elif any(((origin is cls) for cls in ASYNC_CONTEXT_MANAGER_TYPES)):
        return 'typing.AsyncContextManager'
    else:
        extra_origin = getattr(origin, '__extra__', None)
        if (extra_origin is not None):
            return extra_origin
        return origin
def _maybe_get_extra(origin: type) -> Union[(type, str)]:
    if any(((origin is cls) for cls in CONTEXT_MANAGER_TYPES)):
        return 'typing.ContextManager'
    elif any(((origin is cls) for cls in ASYNC_CONTEXT_MANAGER_TYPES)):
        return 'typing.AsyncContextManager'
    else:
        extra_origin = getattr(origin, '__extra__', None)
        if (extra_origin is not None):
            return extra_origin
        return origin