<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _misalign_split(self,alns):
 """Requires alignment strings have been set so for each exon we have query, target and query_quality _has_quality will specify whether or not the quality is meaningful """

    total = []
    z = 0
    for x in alns:
      z += 1
      exon_num = z
      if self._alignment.strand == '-':
        exon_num = (len(alns)-z)+1
      buffer = {'query':x['query'][0],'target':x['target'][0],'query_quality':x['query_quality'][0],'exon':exon_num}
      if buffer['query'] == '-': buffer['nt'] = buffer['target']
      elif buffer['target'] == '-': buffer['nt'] = buffer['query']
      elif buffer['query'] == buffer['target']: buffer['nt'] = buffer['query']
      elif buffer['query'] != buffer['target']: buffer['nt'] = '*'
      else:
	sys.stderr.write("WARNING unkonwn case\n")
      for i in range(1,len(x['query'])):
        qchar = x['query'][i]
        tchar = x['target'][i]
        qualchar = x['query_quality'][i]
        if qchar != tchar and (qchar != '-' and tchar != '-'):
          #classic mismatch
          #print 'mismatch'
          #print buffer
          total.append(buffer)
          buffer = {'query':qchar,'target':tchar,'query_quality':qualchar,'exon':exon_num}
          buffer['nt'] = '*'
        elif qchar == buffer['nt'] or tchar == buffer['nt']:
          # its a homopolymer match
          buffer['query'] += qchar

          buffer['target'] += tchar
          buffer['query_quality'] += qualchar
          #print 'homopoly'
        else:
          #print 'new thing'
          #print buffer
          total.append(buffer)
          buffer = {'query':qchar,'target':tchar,'query_quality':qualchar,'exon':exon_num}
          if qchar == '-': buffer['nt'] = tchar
          else:  buffer['nt'] = qchar
      total.append(buffer)
    result = [AlignmentErrors.HPAGroup(self,y) for y in total]
    return result