code: def identity_abs(aseq, bseq):
      
      assert len(aseq) == len(bseq)
      return sum(a == b
                 for a, b in zip(aseq, bseq)
                 if not (a in '-.' and b in '-.'))
docs: Compute absolute identity (# matching sites) between sequence strings.