def date_range_frequency(filename):# {{{
    """Get the frequency of date range"""
    if filename.find('day') != -1:
        freq = 'D'
    elif filename.find('week') != -1:
        freq = 'W-MON'
    elif filename.find('month') != -1:
        freq = 'MS'
    elif filename.find('year') != -1:
        freq = 'AS-JAN'
    else:
        freq = 'D'
    return freq