docs: def remove_spurious_insertions(scaffolds):
  
      """Remove all bins whose left and right neighbors belong to the same,
      different scaffold.
  
      Example with three such insertions in two different scaffolds:
  
          >>> scaffolds = {
          ...     "scaffold1": [
          ...         ["contig1", 0, 0, 100, 1],
          ...         ["contig1", 1, 100, 200, 1],
          ...         ["contig23", 53, 1845, 2058, -1], # <-- insertion
          ...         ["contig1", 4, 254, 408, 1],
          ...         ["contig1", 7, 805, 1253, 1],
          ...         ["contig5", 23, 1500, 1605, -1],
          ...         ["contig65", 405, 32145, 45548, -1], # <-- insertion
          ...         ["contig5", 22, 1385, 1499, -1],
          ...     ],
          ...     "scaffold2": [
          ...         ["contig8", 0, 0, 250, 1],
          ...         ["contig17", 2454, 8754, -1], # <-- insertion
          ...         ["contig8", 2, 320, 480, 1],
          ...      ],
          ... }
  
          >>> new_scaffolds = remove_spurious_insertions(scaffolds)
          >>> for my_bin in new_scaffolds['scaffold1']:
          ...     print(my_bin)
          ...
          ['contig1', 0, 0, 100, 1]
          ['contig1', 1, 100, 200, 1]
          ['contig1', 4, 254, 408, 1]
          ['contig1', 7, 805, 1253, 1]
          ['contig5', 23, 1500, 1605, -1]
          ['contig5', 22, 1385, 1499, -1]
  
          >>> for my_bin in new_scaffolds['scaffold2']:
          ...     print(my_bin)
          ...
          ['contig8', 0, 0, 250, 1]
          ['contig8', 2, 320, 480, 1]
  
  
      """
  
      scaffolds = format_info_frags(scaffolds)
      new_scaffolds = {}
      for name, scaffold in scaffolds.items():
          new_scaffold = []
          if len(scaffold) > 2:
              for i in range(len(scaffold)):
                  # First take care of edge cases: *-- or --*
                  if i == 0:
                      if not (
                          scaffold[i][0] != scaffold[i + 1][0]
                          and scaffold[i + 1][0] == scaffold[i + 2][0]
                      ):
                          new_scaffold.append(scaffold[i])
                  elif i == len(scaffold) - 1:
                      if not (
                          scaffold[i][0] != scaffold[i - 1][0]
                          and scaffold[i - 1][0] == scaffold[i - 2][0]
                      ):
                          new_scaffold.append(scaffold[i])
                  # Otherwise, looking for -*-
                  else:
                      if not (
                          scaffold[i - 1][0] == scaffold[i + 1][0]
                          and scaffold[i - 1][0] != scaffold[i][0]
                      ):
                          new_scaffold.append(scaffold[i])
          else:
              # Can't remove insertions if 2 bins or less
              new_scaffold = copy.deepcopy(scaffold)
  
          new_scaffolds[name] = new_scaffold
  
      return new_scaffolds