from typing import Dict
from typing import Any


def format_mm_json(
    data_json: Dict[str, Any],
) -> str:
    """
    Purpose:
        Format the json to a text response
    Args:
        data_json: multi modal data
    Returns:
        text: formatted text
    """
    text = ""

    bike_paths = data_json["bike_paths"]
    metro_stations = data_json["metro_stations"]
    sidewalks = data_json["sidwalks"]

    if len(bike_paths) > 0:
        text += "Nearby Bike Trails:  \n"
        for bike_path in bike_paths:
            text += f"{bike_path}  \n"

    if len(metro_stations) > 0:
        text += "Nearby Metro Stations:  \n"
        for metro in metro_stations:
            text += f"{metro}  \n"

    if len(sidewalks) > 0:
        text += "Nearby Sidewalk types:  \n"

        sidewalk_counter = {}
        for sw in sidewalks:
            if not sw in sidewalk_counter:
                sidewalk_counter[sw] = 0
            sidewalk_counter[sw] += 1

        for key in list(sidewalk_counter.keys()):
            text += f"{key}: {sidewalk_counter[key]}  \n"

    return text