code: def dt64_to_dt(dt64):
      
      ts = (dt64 - np.datetime64('1970-01-01T00:00:00')) / np.timedelta64(1, 's')
      return dt.datetime.utcfromtimestamp(ts)
docs: Safely converts NumPy datetime64 to a datetime object.