def _compute_gapopen_num(hsp):
 gapopen = 0
 for seq_type in ('query', 'hit'):
  seq = str(getattr(hsp, seq_type).seq)
  gapopen += len(re.findall(_RE_GAPOPEN, seq))
 return gapopen

def _compute_gapopen_num ( hsp ) : gapopen = 0 for seq_type in ( 'query' , 'hit' ) : seq = str ( getattr ( hsp , seq_type ) . seq ) gapopen += len ( re . findall ( _RE_GAPOPEN , seq ) ) return gapopen
returns the number of gap openings in the given hsp .