def print_time(t, ref_time = None):
    lt = time.localtime(t)

    # ref_time is for testing
    if ref_time is None:
        now = time.localtime()
    else:
        now = time.localtime(ref_time)

    if lt.tm_year != now.tm_year:
        return time.strftime('%b %d %Y, %I:%M:%S %p', lt)
    elif lt.tm_mon != now.tm_mon:
        return time.strftime('%b %d, %I:%M:%S %p', lt)
    elif lt.tm_mday != now.tm_mday:
        return time.strftime('%a %b %d, %I:%M:%S %p', lt)
    else:
        return time.strftime('%I:%M:%S %p', lt)
dataset/ETHPy150Open NVIDIA/DIGITS/digits/utils/time_filters.py/print_time/original