from datetime import datetime


def convert_return_back_to_d(dt, original_input):
    """
    Given the original input of a function and the datetime object it produced,
    convert it back to a date object if the original input was a date object.
    """
    if type(original_input) is datetime.date:
        return dt.date()
    else:
        return dt