code: def _datetime_key_for_merge(self, logevent):
          
          if not logevent:
              # if logfile end is reached, return max datetime to never
              # pick this line
              return datetime(MAXYEAR, 12, 31, 23, 59, 59, 999999, tzutc())
  
          # if no datetime present (line doesn't have one) return mindate
          # to pick this line immediately
          return logevent.datetime or datetime(MINYEAR, 1, 1, 0, 0, 0, 0,
                                               tzutc())
docs: Helper method for ordering log lines correctly during merge.