code: def from_timedelta(cls, datetime_obj, duration):
          
          if duration.total_seconds() > 0:
              return TimeInterval(datetime_obj, datetime_obj + duration)
          else:
              return TimeInterval(datetime_obj + duration, datetime_obj)
docs: Create a new TimeInterval object from a start point and a duration.
  
          If duration is positive, datetime_obj is the start of the interval;
          if duration is negative, datetime_obj is the end of the interval.
  
          Parameters
          ----------
          datetime_obj : datetime.datetime
          duration : datetime.timedelta
  
          Returns
          -------
          neutils.time.TimeInterval