def analyze_facility_types()

in gemini/agents/research-multi-agents/ev_agent/api_handler/api_02_EV_Infra_StationAnalysis.py [0:0]


def analyze_facility_types(stations: List[Dict]) -> FacilityTypeCount:
    """Analyze facility types from station data"""
    counts = FacilityTypeCount()

    for station in stations:
        # Handle potential None values properly
        facility_type = (station.get("facility_type") or "").lower()

        if "parking" in facility_type or "garage" in facility_type:
            counts.parking_garage += 1
        elif "retail" in facility_type or "shopping" in facility_type:
            counts.retail += 1
        elif "workplace" in facility_type or "office" in facility_type:
            counts.workplace += 1
        else:
            counts.other += 1

    return counts