def generate_pin(color, coordinate):
    """
    generates a pin for the stops
    :param color: the color of the pin
    :param coordinate: the coordinate of the pin
    :return: the string to write to the KML file
    """
    output = ""     # output string
    description = ""    # description of pin
    image_url = ""  # the image of the pin
    if color == 'yellow':
        description = "Stop For Errand"
        image_url = 'http://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png'
    if color == 'pink':
        description = "Stop/rolling stop for sign or light"
        image_url = "http://maps.google.com/mapfiles/kml/pushpin/pink-pushpin.png"

    output = """    # use KML syntax to make a placemark(the pin)
        <Placemark>
        <description>%s</description>
        <Style id="normalPlacemark">
<IconStyle>
<scale>1.5</scale>
<Icon><href>%s</href></Icon>
</IconStyle>
</Style>
            <Point><coordinates>%s</coordinates></Point>
            </Placemark>
                        """ % (description, image_url, coordinate)
    return output