code: def truncate(self, s):
          
          if s == 'second':
              self._dt = self._dt.replace(microsecond=0)
          elif s == 'minute':
              self._dt = self._dt.replace(second=0, microsecond=0)
          elif s == 'hour':
              self._dt = self._dt.replace(minute=0, second=0, microsecond=0)
          elif s == 'day':
              self._dt = self._dt.replace(hour=0, minute=0, second=0, microsecond=0)
          elif s == 'month':
              self._dt = self._dt.replace(day=1, hour=0, minute=0, second=0, microsecond=0)
          elif s == 'year':
              self._dt = self._dt.replace(month=1, day=1, hour=0, minute=0, second=0, microsecond=0)
          else:
              raise ValueError("Invalid truncation level")
  
          return self
docs: Truncate the delorian object to the nearest s
          (second, minute, hour, day, month, year)
  
          This is a destructive method, modifies the internal datetime
          object associated with the Delorean object.
  
          .. testsetup::
  
              from datetime import datetime
              from delorean import Delorean
  
          .. doctest::
  
              >>> d = Delorean(datetime(2015, 1, 1, 12, 10), timezone='US/Pacific')
              >>> d.truncate('hour')
              Delorean(datetime=datetime.datetime(2015, 1, 1, 12, 0), timezone='US/Pacific')