code: def distribute_overlap(lol):
      """Distributes the overlapped speech equally among the adjacent segments
      with different speakers.
  
      Arguments
      ---------
      lol : list of list
          It has each list structure as [rec_id, sseg_start, sseg_end, spkr_id].
  
      Returns
      -------
      new_lol : list of list
          It contains the overlapped part equally divided among the adjacent
          segments with different speaker IDs.
  
      Example
      -------
      >>> from speechbrain.processing import diarization as diar
      >>> lol = [['r1', 5.5, 9.0, 's1'],
      ... ['r1', 8.0, 11.0, 's2'],
      ... ['r1', 11.5, 13.0, 's2'],
      ... ['r1', 12.0, 15.0, 's1']]
      >>> diar.distribute_overlap(lol)
      [['r1', 5.5, 8.5, 's1'], ['r1', 8.5, 11.0, 's2'], ['r1', 11.5, 12.5, 's2'], ['r1', 12.5, 15.0, 's1']]
      """
  
      new_lol = []
      sseg = lol[0]
  
      # Add first sub-segment here to avoid error at: "if new_lol[-1] != sseg:" when new_lol is empty
      # new_lol.append(sseg)
  
      for i in range(1, len(lol)):
          next_sseg = lol[i]
          # No need to check if they are different speakers.
          # Because if segments are overlapped then they always have different speakers.
          # This is because similar speaker's adjacent sub-segments are already merged by "merge_ssegs_same_speaker()"
  
          if is_overlapped(sseg[2], next_sseg[1]):
              # Get overlap duration.
              # Now this overlap will be divided equally between adjacent segments.
              overlap = sseg[2] - next_sseg[1]
  
              # Update end time of old seg
              sseg[2] = sseg[2] - (overlap / 2.0)
  
              # Update start time of next seg
              next_sseg[1] = next_sseg[1] + (overlap / 2.0)
  
              if len(new_lol) == 0:
                  # For first sub-segment entry
                  new_lol.append(sseg)
              else:
                  # To avoid duplicate entries
                  if new_lol[-1] != sseg:
                      new_lol.append(sseg)
  
              # Current sub-segment is next sub-segment
              sseg = next_sseg
  
          else:
              # For the first sseg
              if len(new_lol) == 0:
                  new_lol.append(sseg)
              else:
                  # To avoid duplicate entries
                  if new_lol[-1] != sseg:
                      new_lol.append(sseg)
  
              # Update the current sub-segment
              sseg = next_sseg
  
      # Add the remaining last sub-segment
      new_lol.append(next_sseg)
  
      return new_lol
  
imports: import csv
  import numbers
  import warnings
  import scipy
  import pytest
  import numpy
  from scipy import sparse
  from scipy.sparse.linalg import eigsh
  from scipy.sparse.csgraph import connected_components
  from scipy.sparse.csgraph import laplacian
label_desc: Use image node_id 6 for calling a global function with example usage: distribute_overlap(lol) and returns: new_lol