def next_m(schedules, latest=None):
    """
    Get the next identifiable date/time tuple resulting from an iterable of
    schedules.

    Keyword arguments:
       schedules -- an iterable of schedules
          a single schedule is a three value tuple consisting of (identifier,
          start_date, interval)

       latest -- the most recent date that the schedule ran (optional, if not
       provided, start_date will be treated as the latest for each schedule)

    Returns a two value tuple consisting of the identifier of the matching schedule,
    and the 7 value date/time tuple.
    (identifier, (year, month, day, hour, minute, second, microsecond))

    Example:

       >>> import schedaddle
       >>> schedaddle.next_m([
       ... ('first', (2010, 1, 31), 'monthly'),
       ... ('second', (2010, 1, 31), 'weekly')])
       ('second', (2010, 2, 7, 0, 0, 0, 0))

       >>> import schedaddle
       >>> schedaddle.next_m([
       ... ('first', (2010, 1, 31), (0, 1, 0, 0, 0, 0, 0)),
       ... ('second', (2010, 1, 31, 12, 30), 'weekly')],
       ... latest=(2010, 2, 21))
       ('first', (2010, 2, 28, 0, 0, 0, 0))

    """
    recent_schedule = None
    for schedule in schedules:
        test_schedule = schedule[0], next(schedule[1], schedule[2], latest)
        if recent_schedule is None or test_schedule[1] < recent_schedule[1]:
            recent_schedule = test_schedule
    return recent_schedule
