def extract_stream_indicator(s: str) -> Union[(str, int)]:
    try:
        data = ujson.loads(s)
    except (ValueError, TypeError):
        return s
    if isinstance(data, list):
        if (len(data) != 1):
            raise JsonableError(_('Expected exactly one stream'))
        data = data[0]
    if isinstance(data, str):
        return data
    if isinstance(data, int):
        return data
    raise JsonableError(_('Invalid data type for stream'))
def extract_stream_indicator(s: str) -> Union[(str, int)]:
    try:
        data = ujson.loads(s)
    except (ValueError, TypeError):
        return s
    if isinstance(data, list):
        if (len(data) != 1):
            raise JsonableError(_('Expected exactly one stream'))
        data = data[0]
    if isinstance(data, str):
        return data
    if isinstance(data, int):
        return data
    raise JsonableError(_('Invalid data type for stream'))