def parse_break_str(txt):
    txt = txt.strip()
    if len(txt.split()) == 2:
        n, units = txt.split()
    else:
        n,units = 1, txt
    units = units.rstrip('s') # e.g. weeks => week
    n = int(n)
    return n, units

# matplotlib's YearLocator uses different named
# arguments than the others
parses '10 weeks' into tuple (10, week).
dataset/ETHPy150Open yhat/ggplot/ggplot/utils/date_breaks.py/parse_break_str