from datetime import datetime


def _dt_has_tz(dt: datetime):
    """From the Python docs: https://docs.python.org/3/library/datetime.html

    An object of type time or datetime may be naive or aware. A datetime object
    d is aware if d.tzinfo is not None and d.tzinfo.utcoffset(d) does not
    return None. If d.tzinfo is None, or if d.tzinfo is not None but
    d.tzinfo.utcoffset(d) returns None, d is naive. A time object t is aware if
    t.tzinfo is not None and t.tzinfo.utcoffset(None) does not return None.
    Otherwise, t is naive.
    """
    return dt.tzinfo is not None and dt.tzinfo.utcoffset(dt) is not None