code: def sfiles_to_event(sfile_list):
      
      event_list = []
      sort_list = [(readheader(sfile).origins[0].time, sfile)
                   for sfile in sfile_list]
      sort_list.sort(key=lambda tup: tup[0])
      sfile_list = [sfile[1] for sfile in sort_list]
      catalog = Catalog()
      for i, sfile in enumerate(sfile_list):
          event_list.append((i, sfile))
          catalog.append(readheader(sfile))
      # Hand off to sister function
      write_event(catalog)
      return event_list
docs: Write an event.dat file from a list of Seisan events
  
      :type sfile_list: list
      :param sfile_list: List of s-files to sort and put into the database
  
      :returns: List of tuples of event ID (int) and Sfile name