def scan_leap(clc):
    ''' scan and change month name(number) if necessary
    Arg:
        clc: the astros trimmed to a CLC year
    Return:
        the Chinese Lunar Calendar astro with month name adjusted for leap

        '''
    lcstart, lcend = clc[0]['date'], clc[-1]['date']
    # scan for leap month
    nmcount = 0
    for d in clc:
        if (d['date'] > lcstart and d['date'] <= lcend and
                                    d['astro'] == 'newmoon'):
            nmcount += 1

    # leap year has more than 12 newmoons between two Winter Solstice
    if nmcount > 12:
        # search leap month from LC 11, to next LC 11, which = 11 + 13
        for m in range(11, 25):
            foundleap = True
            for d in clc:
                if d['astro'] == 'newmoon':
                    continue
                if d['month'] == m and d['astro'] % 30 == 0:
                    foundleap = False
            if foundleap:
                monthofleap = m
                break

        for d in clc:
            if d['month'] == monthofleap:
                d['month'] += -1 + 100  # add 100 to distinguish leap month
            elif d['month'] > monthofleap:
                d['month'] -= 1

    for d in clc:
        if d['month'] > 12:
            d['month'] -= 12

    return clc
 scan and change month name(number) if necessary
    Arg:
        clc: the astros trimmed to a CLC year
    Return:
        the Chinese Lunar Calendar astro with month name adjusted for leap

        
lunarcalbase.py