def get_end_day(date):
    """Takes a string such as ``2009-07-23`` and returns a datetime object with
    last valid second of this day: 23:59:59.
    """
    try:
        year, month, day = date.split("-")
    except __HOLE__:
        return None
    end = datetime.datetime(int(year), int(month), int(day))
    end = end + datetime.timedelta(1) - datetime.timedelta(microseconds=1)

    return end
dataset/ETHPy150Open diefenbach/django-lfs/lfs/core/utils.py/get_end_day