in src/functions_framework/event_conversion.py [0:0]
def is_convertable_cloud_event(request) -> bool:
"""Is the given request a known CloudEvent that can be converted to background event."""
if is_binary(request.headers):
event_type = request.headers.get("ce-type")
event_source = request.headers.get("ce-source")
return (
event_source is not None
and event_type is not None
and event_type in _CE_TO_BACKGROUND_TYPE
)
return False