def METHOD_NAME(offset):
    if not offset:
        return timedelta()
    t = timedelta()
    if offset[0].isdigit():
        sign = 1
    else:
        try:
            sign = { '+' : 1, '-' : -1 }[offset[0]]
        except KeyError:
            raise KeyError('Invalid offset: %s' % offset)
        offset = offset[1:]
    while offset:
        i = 1
        while offset[:i].isdigit() and i <= len(offset):
            i += 1
        num = int(offset[:i-1])
        offset = offset[i-1:]
        i = 1
        while offset[:i].isalpha() and i <= len(offset):
            i += 1
        unit = offset[:i-1]
        offset = offset[i-1:]
        unitString = getUnitString(unit)
        if unitString == MONTHS_STRING:
            unitString = DAYS_STRING
            num = num * 30
        if unitString == YEARS_STRING:
            unitString = DAYS_STRING
            num = num * 365
        t += timedelta(**{ unitString : sign * num})
    return t