code: def ungap_index_map(sequence, gap_chars='-'):
      
      counter = itertools.count(0).__next__
      ungap_indexes = [
          counter() if c not in gap_chars else None for c in iter(sequence)
      ]
      return dict(
          (ungapped, gapped)
          for ungapped, gapped in zip(ungap_indexes, range(len(sequence)))
          if ungapped is not None)
docs: Returns a dict mapping from an index in the ungapped sequence to an index
      in the gapped sequence.
  
      >>> ungap_index_map('AC-TG-')
      {0: 0, 1: 1, 2: 3, 3: 4}