Return the unit number where to place a unit placed on a service.

    Receive the service name and a dict mapping service names to the current
    number of placed units in that service.

def _next_unit_in_service(service, placed_in_services):
    """Return the unit number where to place a unit placed on a service.

    Receive the service name and a dict mapping service names to the current
    number of placed units in that service.
    """
    current = placed_in_services.get(service)
    number = 0 if current is None else current + 1
    placed_in_services[service] = number
    return number