code: def eeg_create_mne_events(onsets, conditions=None):
      
      event_id = {}
  
      if conditions is None:
          conditions = ["Event"] * len(onsets)
  
      # Sanity check
      if len(conditions) != len(onsets):
          print("NeuroKit Warning: eeg_create_events(): conditions parameter of different length than onsets. Aborting.")
          return()
  
  
  
      event_names = list(set(conditions))
  #    event_index = [1, 2, 3, 4, 5, 32, 64, 128]
      event_index = list(range(len(event_names)))
      for i in enumerate(event_names):
          conditions = [event_index[i[0]] if x==i[1] else x for x in conditions]
          event_id[i[1]] = event_index[i[0]]
  
      events = np.array([onsets, [0]*len(onsets), conditions]).T
      return(events, event_id)
docs: Create MNE compatible events.
  
      Parameters
      ----------
      onsets : list or array
          Events onsets.
      conditions : list
          A list of equal length containing the stimuli types/conditions.
  
  
      Returns
      ----------
      (events, event_id) : tuple
          MNE-formated events and a dictionary with event's names.
  
      Example
      ----------
      >>> import neurokit as nk
      >>> events, event_id = nk.eeg_create_mne_events(events_onset, conditions)
  
      Authors
      ----------
      - `Dominique Makowski <https://dominiquemakowski.github.io/>`_