<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def ensure_datetime(dobj, time_part=None):
 """ Adds time part to dobj if its a date object, returns dobj untouched if its a datetime object. """

    if isinstance(dobj, dt.datetime):
        return dobj
    return dt.datetime.combine(dobj, time_part or dt.time())