def get_stations_by_town(stations):
    """
    Returns a dictionary consisting of a (key, value) pair of towns (key) and a list of the
    stations inside of them (value)
    """
    towns = {} # dictionary of towns
    for station in stations:
        town = station.town 
        if town in towns:
            towns[town].append(station)
        else:
            towns[town] = [station]
    return towns