import typing
import json


def _get_sse_event_payload(data: str) -> typing.Union[str, dict]:
    """Maps incoming event JSON payload to it's pythonic type.

    """
    try:
        return json.loads(data)
    except json.JSONDecodeError:
        return data