code: def merge_ssegs_same_emotion_adjacent(lol):
      """Merge adjacent sub-segs if they are the same emotion.
      Arguments
      ---------
      lol : list of list
          Each list contains [utt_id, sseg_start, sseg_end, emo_label].
      Returns
      -------
      new_lol : list of list
          new_lol contains adjacent segments merged from the same emotion ID.
      Example
      -------
      >>> from speechbrain.utils.EDER import merge_ssegs_same_emotion_adjacent
      >>> lol=[['u1', 0.0, 7.0, 'a'],
      ... ['u1', 7.0, 9.0, 'a'],
      ... ['u1', 9.0, 11.0, 'n'],
      ... ['u1', 11.0, 13.0, 'n'],
      ... ['u1', 13.0, 15.0, 'n'],
      ... ['u1', 15.0, 16.0, 'a']]
      >>> merge_ssegs_same_emotion_adjacent(lol)
      [['u1', 0.0, 9.0, 'a'], ['u1', 9.0, 15.0, 'n'], ['u1', 15.0, 16.0, 'a']]
      """
      new_lol = []
  
      # Start from the first sub-seg
      sseg = lol[0]
      flag = False
      for i in range(1, len(lol)):
          next_sseg = lol[i]
          # IF sub-segments overlap AND has same emotion THEN merge
          if (
              is_overlapped(sseg[2], next_sseg[1])
              and sseg[3] == next_sseg[3]
          ):
              sseg[2] = next_sseg[2]  # just update the end time
              # This is important. For the last sseg, if it is the same emotion then merge
              # Make sure we don't append the last segment once more. Hence, set FLAG=True
              if i == len(lol) - 1:
                  flag = True
                  new_lol.append(sseg)
          else:
              new_lol.append(sseg)
              sseg = next_sseg
      # Add last segment only when it was skipped earlier.
      if flag is False:
          new_lol.append(lol[-1])
  
      return new_lol
  
label_desc: Use image node_id 4 for calling a global function with example usage: merge_ssegs_same_emotion_adjacent(lol) and returns: new_lol