def search_services(query, services, quiet):
    """
    Search map services for the given query string.

    query is a string to search for in featureclasses, databases, maps, or service names
    services is a list of MapService objects to search through
    quiet is a value in [0, 1, 2] that determines what to return:
        0: all info
        1: name and url
        2: just url

    returns a list of string representations of the matching MapService objects.
    """
    cards = set()
    for svc in services:
        if (svc.uses_feature(query) or svc.uses_database(query) or 
            query.upper() in svc.mxd.upper() or query.upper() in svc.name.upper()):
            if quiet >= 2:
                cards.add(svc.veryquiet_repr())
            elif quiet == 1:
                cards.add(svc.quiet_repr())
            else:
                cards.add(repr(svc))
    return list(cards)