def is_before(y, by, m=12, d=None, bm=12, bd=None):
    '\n    tests whether a date is on or before another date\n\n    Parameters\n    ----------\n    y : int\n      the year to be tested\n    by : int\n      the before year\n    m : int or str\n      the month to be tested. Optional, defaults to Dec\n    d : int\n      the day to be tested.  Defaults to last day of the month\n    bm : int or str\n      the before month.  Optional, defaults to Dec\n    bd: int\n      the before day.  Optional, defaults to last day of the month\n\n    Returns\n    -------\n    True if the target date is the same as, or earlier than, the before date\n\n    '
    if (not d):
        d = monthrange(y, month_to_int(m))[1]
    if (not bd):
        bd = monthrange(by, month_to_int(bm))[1]
    b = '{}/{}/{}'.format(bd, month_to_int(bm), by)
    d = '{}/{}/{}'.format(d, month_to_int(m), y)
    before = time.mktime(datetime.strptime(b, '%d/%m/%Y').timetuple())
    date = time.mktime(datetime.strptime(d, '%d/%m/%Y').timetuple())
    return (before >= date)
tests whether a date is on or before another date

Parameters
----------
y : int
  the year to be tested
by : int
  the before year
m : int or str
  the month to be tested. Optional, defaults to Dec
d : int
  the day to be tested.  Defaults to last day of the month
bm : int or str
  the before month.  Optional, defaults to Dec
bd: int
  the before day.  Optional, defaults to last day of the month

Returns
-------
True if the target date is the same as, or earlier than, the before date
def is_before(y, by, m=12, d=None, bm=12, bd=None):
    '\n    tests whether a date is on or before another date\n\n    Parameters\n    ----------\n    y : int\n      the year to be tested\n    by : int\n      the before year\n    m : int or str\n      the month to be tested. Optional, defaults to Dec\n    d : int\n      the day to be tested.  Defaults to last day of the month\n    bm : int or str\n      the before month.  Optional, defaults to Dec\n    bd: int\n      the before day.  Optional, defaults to last day of the month\n\n    Returns\n    -------\n    True if the target date is the same as, or earlier than, the before date\n\n    '
    if (not d):
        d = monthrange(y, month_to_int(m))[1]
    if (not bd):
        bd = monthrange(by, month_to_int(bm))[1]
    b = '{}/{}/{}'.format(bd, month_to_int(bm), by)
    d = '{}/{}/{}'.format(d, month_to_int(m), y)
    before = time.mktime(datetime.strptime(b, '%d/%m/%Y').timetuple())
    date = time.mktime(datetime.strptime(d, '%d/%m/%Y').timetuple())
    return (before >= date)