def mark_lunarcal_month(clc):
    ''' scan and modify the Chinese Lunar Calendar Astro list for start/end of
    Chinese Lunar year and leapmonth'''

    # scan last and this Winter Solstice
    for d in clc:
        if d['astro'] == -90:
            lastws = d['date']
        elif d['astro'] == 270:
            lcend = d['date']
            break

    # the newmoon contains last Winter Solstice marks start of CLC year
    for d in clc:
        if d['date'] <= lastws and d['astro'] == 'newmoon':
            lcstart = d['date']
        elif d['date'] > lastws:
            break

    # mark month name, 11 is the month contains Winter Solstice
    newmoondate = [d['date'] for d in clc if d['astro'] == 'newmoon']
    mname = 11
    for i in range(len(newmoondate) - 1):
        thisnm, nextnm = newmoondate[i], newmoondate[i + 1]
        if thisnm < lcstart:
            continue

        for d in clc:
            if thisnm <= d['date'] and d['date'] < nextnm:
                d['month'] = mname
            elif d['date'] >= nextnm:
                break
        mname += 1

    # trim to days between two Winter Solstice
    clc = [d for d in clc if d['date'] >= lcstart and d['date'] <= lcend]

    return scan_leap(clc)
 scan and modify the Chinese Lunar Calendar Astro list for start/end of
    Chinese Lunar year and leapmonth
lunarcalbase.py