code: def accumulate_scores( scoring_scheme, text1, text2, skip_ref_gaps=False ):
      
      if skip_ref_gaps:
          rval = zeros( len( text1 ) - text1.count( scoring_scheme.gap1 ) )
      else:
          rval = zeros( len( text1 ) )
      score = 0
      pos = 0
      last_gap_a = last_gap_b = False
      for i in range( len( text1 ) ):
          a = text1[i]
          b = text2[i]
          # Ignore gap/gap pair
          if a == scoring_scheme.gap1 and b == scoring_scheme.gap2: 
              continue
          # Gap in first species
          elif a == scoring_scheme.gap1:
              score -= scoring_scheme.gap_extend
              if not last_gap_a:
                 score -= scoring_scheme.gap_open
                 last_gap_a = True
                 last_gap_b = False
          # Gap in second species
          elif b == scoring_scheme.gap2:
              score -= scoring_scheme.gap_extend
              if not last_gap_b:
                 score -= scoring_scheme.gap_open
                 last_gap_a = False
                 last_gap_b = True
          # Aligned base
          else:   
              score += scoring_scheme._get_score((ord(a),ord(b)))
              last_gap_a = last_gap_b = False
          if not( skip_ref_gaps ) or a != scoring_scheme.gap1:
              rval[pos] = score
              pos += 1
      return rval
docs: Return cumulative scores for each position in alignment as a 1d array.
      
      If `skip_ref_gaps` is False positions in returned array correspond to each
      column in alignment, if True they correspond to each non-gap position (each
      base) in text1.