from typing import Dict
from typing import Any


def _get_event_data_from_text(text: str) -> Dict[str, Any]:
    """Returns the event data from the text.

    Args:
        text: The event text.

    Returns:
        A dictionary with the event data.
    """
    if len(text.split(", ")) == 5:
        head, content, start_date, end_date, location = text.split(", ")
        location = location.replace("\n", "")
    else:
        head, content, start_date, end_date = text.split(", ")
        end_date = end_date.replace("\n", "")
        location = ""

    return {
        "head": head,
        "content": content,
        "start_date": start_date,
        "end_date": end_date,
        "location": location,
    }