'Return  bucket that matches given year or return the year
if no matching bucket.'

def find_bucket_year(self, year):

    for ys in self.year_spans:
        if (ys['from'] <= int(year) <= ys['to']):
            if ('str' in ys):
                return ys['str']
            else:
                return format_span(self.ys_repr_mode['fmt'], ys['from'], ys['to'], self.ys_repr_mode['fromnchars'], self.ys_repr_mode['tonchars'])
    return year
